/*
	File:		Entity.cpp
	Author:		Ben Feldmann
	Purpose:	Base class for game entities
*/

#include "Entity.h"
#include "SGD Wrappers\CSGD_TextureManager.h"


Entity::Entity() 
{
	textureID = -1;
}

void Entity::Update(float elapsed)
{

}

void Entity::Render()
{
	if(textureID != -1)
	{
		CSGD_TextureManager::GetInstance()->Draw(textureID, int(posX), int(posY));
	}
}

int Entity::GetType()
{
	return type;
}

RECT Entity::GetRect()
{
	RECT rect = {(LONG)posX, (LONG)posY, (LONG)posX+width, (LONG)posY+height};
	return rect;
}

bool Entity::CheckCollision(IEntity * base)
{
	RECT rect = {};
	if(IntersectRect(&rect, &base->GetRect(), &GetRect()))
		return true;
	else
		return false;
}